package com.easy.mapper;

import com.easy.bean.Doctor;
import com.easy.util.Page;
import com.easy.vo.DoctorWithDeptVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface DoctorMapper {
    int add(@Param("doctor") Doctor doctor);

    int del(@Param("id")Integer id);

    int edit(@Param("doctor")Doctor doctor);

    List<Doctor> all(@Param("doctor")Doctor doctor);

    Doctor one(@Param("id")Integer id);

    int count(@Param("doctor") Doctor doctor);

    // 接口方法参数顺序：Doctor 在前，Page 在后
    List<Doctor> page(@Param("doctor") Doctor doctor, @Param("page") Page page);

    List<DoctorWithDeptVO> pageWithDepartment(@Param("doctor") Doctor doctor,
                                              @Param("page") Map<String, Object> page);

    // 新增：统计
    int countWithDepartment(@Param("doctor") Doctor doctor);
}
